<script setup>
defineProps({
    title:{
        required:true,
        type:String
    }
})

</script>

<template>
    <el-card class="pageContainer">
        <template #header>
            <div class="header">
                <span>{{ title }}</span>
                <div class="extend">
                    <slot name="addButton"></slot>
                </div>
            </div>
        </template>
        <slot></slot>
    </el-card>
  </template>
<style scoped lang="scss">
.pageContainer {
  padding: 20px;
  background-color: #f9f9f9;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 18px;
  font-weight: bold;
  color: #333;
  margin-bottom: 20px;
}

.extend {
  display: flex;
  gap: 10px;
}

.footer {
  text-align: center;
  font-size: 14px;
  color: #666;
  margin-top: 20px;
}

.el-button {
  background-color: #409eff;
  color: #fff;
  border: none;
  border-radius: 4px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  transition: background-color 0.3s;
}

.el-button:hover {
  background-color: #66b1ff;
}
</style>